import service from './request';

//-------------------------------------------☃️-----樊鹏-----☃️-------------------------------------------

// 注册
export function user_register(params = {}) {
    return service.post('/posts', params)
}

// 登录
export function user_login(params = {}) {
    return service.get('/posts', { params })
}

// 价格本 数据渲染
export function get_jiageben(params = {}) {
    return service.get('/jiageben', params)
}

// 商品列表 数据渲染
export function shoppingggg_list(params = {}) {
    return service.get('/shoppppingcart', params)
}

// 商品分类 数据渲染
export function callect_shopping(params = {}) {
    return service.get('/callect', { params })
}

// 商品分类编辑页面模糊查询
export function callect_search(searchData) {
    return service.get(`/callect?shuxing_like=${searchData}`)
}


// 删除某一条数据
export function callect_data(record) {
    return service.delete(`/callect/${record}`)
}


// shoppingcart 删除数据
export function shoppingcart_datadelete(paramsId) {
    return service.delete(`/shoppppingcart/${paramsId}`)
}

// 价格本 删除数据
export function jiageben_deletedata(paramsId) {
    return service.delete(`/jiageben/${paramsId}`)
}

//  商品模糊搜索  todo shoppingcart
export function shoppingcart_search( params ) {
    return service.get( `/shoppppingcart?shopping_like=${ params }` )
}


//-------------------------------------------☃️-----樊鹏-----☃️-------------------------------------------

//-------------------------------------------☃️-----张伟-----☃️-------------------------------------------
//员工管理列表
export function Staff_list(params = {}) {
    return service.get('/StaffManagetable', { params })
}

//员工状态的请求
export function Staff_Leave(params = {}) {
    return service.get('/StaffManageLeave', { params })
}

//员工职位的请求
export function Staff_Job(params = {}) {
    return service.get('/StaffManageJob', { params })
}

//员工管理搜索的请求
// export function Staff_Search(params) {
//     return service.get(`/StaffManagetable?account=${params.account}&leave=${params.leave}&name=${params.name}&job=${params.job}`)
// }

//员工管理搜索的请求(模糊搜索)
export function Staff_Search(params = {}) {
    return service.get('/StaffManagetable', { params })
}

//公司架构数据列表
export function companyBuild_list(params = {}) {
    return service.get('/CompanyBuildTable', { params })
}

//权限分配列表
export function LimitPlan_list(params = {}) {
    return service.get('/LimitPlanTable', { params })
}

//员工管理增加员工
export function Staff_add(params = {}) {
    return service.post('/StaffManagetable', params)
}

//员工管理单独删除
export function Staff_sub(record) {
    return service.delete(`/StaffManagetable/${record}`)
}

//员工管理编辑
export function Staff_edit(record) {
    console.log(record.id);
    return service.patch(`/StaffManagetable/${record.id}`, { userid: record.userid, name: record.name, account: record.account, department: record.department, job: record.job, phone: record.phone, leave: record.leave, time: record.time })
}

//公司架构搜索(模糊搜索)
export function CompanyBuild_Search(value) {
    // console.log(value.pwname);
    return service.get(`/CompanyBuildTable?pwname_like=${ value }`)
}

//公司架构添加
export function CompanyBuild_add(params = {}) {
    return service.post('/CompanyBuildTable', params)
}

//公司架构编辑
export function CompanyBuild_edit(record) {
    console.log(record.id);
    return service.patch(`/CompanyBuildTable/${record.id}`, { pwId: record.pwId, pwname: record.pwname, pwcontent: record.pwcontent })
}

//权限分配搜索(模糊搜索)
export function LimitPlan_Search(value) {
    return service.get(`/LimitPlanTable?Powername_like=${ value }`)
}

//权限分配添加
export function LimitPlan_add(params = {}) {
    return service.post('/LimitPlanTable', params)
}

//权限分配编辑
export function LimitPlan_edit(record) {
    console.log(record.id);
    return service.patch(`/LimitPlanTable/${record.id}`, { PowerId: record.PowerId, Powername: record.Powername, Powerlevel: record.Powerlevel,IncludePower: record.IncludePower })
}
//财务报表列表
export function FinanceForm_list(params = {}) {
    return service.get('/FinanceForm', { params })
}
//财务报表搜索(模糊搜索)
export function FinanceForm_Search(value) {
    return service.get(`/FinanceForm?number_like=${ value.number }`)
}


//-------------------------------------------☃️-----张伟-----☃️-------------------------------------------

/* -----------------------------------刘坤------------------------------ */


//*全部订单
export function allindent_list() {
    // console.log(pagination);
    return service.get('/allindent')
}
//*分页
export function allindent_fen(pagination) {
    console.log(pagination);
    return service.get(`/allindent?_page=${pagination.current}&_limit=${pagination.pageSize}`)
}
//*删除
export function allindent_remove(id) {
    return service.delete(`/allindent/${id}`)
}

//*模糊搜索
export function allindent_mohu(value) {
    // console.log(value);
    return service.get(`/allindent?username_like=${value.username}`)
}
//*销售总订单
export function marketform_list() {
    return service.get('/marketform')
}
//*销售-分页
export function marketform_fen(pagination) {
    console.log(pagination);
    return service.get(`/marketform?_page=${pagination.current}&_limit=${pagination.pageSize}`)
}
//*销售-模糊
export function marketform_mohu(value) {
    console.log(value);
    return service.get(`/marketform?kehuname_like=${value.kehuname}`)
}
//*销售-删除
export function marketform_remove(id) {
    return service.delete(`/marketform/${id}`)
}

//*添加
export function marketform_tianjia(value) {
    return service.post('/marketform',{time:value.time,bianhao:value.bianhao,kehuname:value.kehuname,money:value.money,shop:value.shop,shopwarehouse:value.shopwarehouse,zhuangtai:value.zhuangtai})
}

/* -----------------------------------刘坤------------------------------ */

//-------------------------------------------☃️-----蔺梦德-----☃️-------------------------------------------
//WarehousingManagement入库管理表格的请求
export function warehousingmanagement_table(params = {}) {
    return service.get('/WarehousingManagement', { params })
}
// WarehousingManagement入库管理表格的查询
export function warehousingmanagement_search(params = {}) {
    return service.get('/WarehousingManagement', { params })
}
// WarehousingManagement入库管理表格的修改
export function warehousingmanagement_patch(id, params = {}) {
    return service.patch(`/WarehousingManagement/${id}`, params)
}
// WarehousingManagement入库管理表格的增加
export function warehousingmanagement_add(params = {}) {
    return service.post(`/WarehousingManagement`, params)
}
//DeliveryManagement出库管理表格的请求
export function DeliveryManagement_table(params = {}) {
    return service.get('/DeliveryManagement', { params })
}
//DeliveryManagement出库管理表格的查询
export function DeliveryManagement_search(params = {}) {
    return service.get('/DeliveryManagement', { params })
}
// DeliveryManagement出库管理表格的修改
export function DeliveryManagement_patch(id, params = {}) {
    return service.patch(`/DeliveryManagement/${id}`, params)
}
// DeliveryManagement入库管理表格的增加
export function DeliveryManagement_add(params = {}) {
    return service.post(`/DeliveryManagement`, params)
}
//WarehouseStructure仓库结构表格的请求
export function WarehouseStructure_table(params = {}) {
    return service.get('/WarehouseStructure', { params })
}
//WarehouseManagement仓储管理表格的请求
export function warehousemanagement_table(params = {}) {
    return service.get('/WarehouseManagement', { params })
}
//WarehouseManagement仓储管理表格的新增
export function warehousemanagement_add(params = {}) {
    return service.post('/WarehouseManagement',  params )
}
// DeliveryManagement仓储管理表格的修改
export function warehousemanagement_patch(id,params = {}) {
    return service.patch(`/warehousemanagement/${id}`,  params )
}
//DeliveryManagement仓储管理表格的查询
export function WarehouseManagement_search(params = {}) {
    return service.get('/WarehouseManagement', { params })
}
//WarehouseReport仓库报表表格的请求
export function WarehouseReport_table(params = {}) {
    return service.get('/WarehouseReport', { params })
}
//WarehouseReport仓库报表表格的查询
export function WarehouseReport_search(params = {}) {
    return service.get('/WarehouseReport', { params })
}


